﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace ISchool
{
    class IPanel:System.Windows.Forms.Panel
    {
        public IPanel()
        {
            this.Visible = false;
        }
        private System.Windows.Forms.Panel AndPanel;
        public void setIPanelLoction(int x, int y)
        {
            this.Location = new Point(x, y);
            this.Visible = true;
            this.Refresh();
        }
        protected override void OnMouseLeave(EventArgs e)
        {
            base.OnMouseLeave(e);
            this.Visible = false;
        }
        private bool setVisPanel=false;
        public void setVisiblePanel(System.Windows.Forms.Panel t)
        {
            AndPanel = t;
            setVisPanel = true;
        }
        protected override void SetVisibleCore(bool value)
        {
            base.SetVisibleCore(value);
            if(setVisPanel&&value==false)
            {
                AndPanel.Visible = value;
            }
        }
    }
}
